<template>
	<div id="rightCenter1">
		<div class="bg-color-black">
			<div class="d-flex jc-center body-box">
				<dv-scroll-board :config="config" style="width:290px;height:250px" />
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				timer2:null,
				url: {
					pageUrl: '/api/psi/psiUse/page',
				},
				config: {

				}

			}
		},
		mounted() {
			
			this.getResult()
			this.timer2 = setInterval(this.getResult, 60 * 60 * 1000);
		},
		beforeDestroy() {
			clearInterval(this.timer2);
		},
		methods: {

			getResult: function(val) {
				if (val === 1) {
					this.listQuery.pageNum = 1
					this.listQuery.pageSize = 3
				}
				var _this = this
				const param = Object.assign({}, this.listQuery)

				_this.$ajax({
					method: 'get',
					url: _this.url.pageUrl,
					params: param
				}).then(function(resultData2) {
					const resList = resultData2.data.data.pageInfo.records
					var data = []
					for (let i = 0; i < resList.length; i++) {
						data.push([resList[i].articleName, resList[i].useCount,
							resList[i].useTime.substr(5, 11)
						])
					}
					_this.config = {
						header: ['药剂', '使用量', '时间'],
						data: data,
						rowNum: 5, //表格行数
						headerHeight: 35,
						headerBGC: '#0f1325', //表头
						oddRowBGC: '#0f1325', //奇数行
						evenRowBGC: '#171c33', //偶数行
						index: false,
						// align: ['center'],
						columnWidth: [90, 70, 100]
					}
				})


			},
		}

	}
</script>

<style lang="scss" scoped>
</style>